package com.tianruan.dc.modules.sys.user.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tianruan.dc.modules.sys.user.entity.db.PermissionDO;
import com.tianruan.dc.modules.sys.user.entity.dto.PermissionDTO;
import com.tianruan.dc.modules.sys.user.mapper.PermissionMapper;
import com.tianruan.dc.modules.sys.user.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service("permissionService")
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, PermissionDO> implements IPermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    public IPage<PermissionDO> pagePermission(Page<PermissionDO> page, PermissionDTO permissionDTO){
        return permissionMapper.pagePermission(page, permissionDTO);
    }


    public PermissionDO insertPermission(PermissionDO permission){
        permissionMapper.insert(permission);
        return permission;
    }

}